package ooday02;
//继承的测试类
public class ExtendsTest {
    public static void main(String[] args) {
        Student zg = new Student();
        zg.name = "张光";
        zg.age = 45;
        zg.classname="JSD230401";
        zg.stuId="001";
        zg.address="河北";
        zg.eat();
        zg.sleep();
        zg.sayHi();
        zg.study();

//        Student ll = new Student("李宁",45,"佳木斯","jsd2403","002");
//        ll.eat();
//        ll.sleep();
//        ll.sayHi();
//        ll.study();
        Teacher tt = new Teacher("王克晶",40,"北京",6000);
        tt.sayHi();

        Doctor dd = new Doctor("王鹏飞",35,"北京","主治医师");
        dd.eat();
        dd.sleep();
        dd.sayHi();
        dd.cut();

        Person p = new Person();
        p.name = "人";
        p.age =1;
        p.address = "未知";
        p.eat();
        p.sleep();
        p.sayHi();
//        p.stuId="005";//编译报错,超类不能访问派生类的
    }
}
